<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>

<body>
    <!-- 根据数组数据生成div -->
    <div id="app">
        <div v-for="(item,index) in dataList">{{item}}</div>
    </div>
    <!-- ===================================================== -->
    <!-- 根据对象成员数据生成div -->
    <!-- value是对象的属性值，key是对象的属性名，index是对象属性的下标，是vue特地生成的 -->
    <div v-for="(value,key,index) in dog">{{key}}-{{value}}-{{index}}</div>
    <!-- ===================================================== -->
    <!-- 根据字符串数据生成div -->
    <!-- char是字符，index是字符的下标 -->
    <div v-for="(char,index) in heroName">{{char}}-{{index}}</div>

    <!-- 准备数据和vue对象 -->
    <script>
        let vm = new Vue({
            el: '#app',
            data: {
                heroName: 'Lily',
                dataList: [
                    '111',
                    '222',
                    '333'
                ],
                dog: {
                    name: 'Ruiky',
                    gender: false,
                    age: 2,
                    type: '泰迪'
                }
            }
        })
    </script>

</body>

</html>